package com.ai.entity.cameraFunctions;

import com.ai.entity.BasePage;
import com.ai.entity.made.CameraFlowCollectionPlatform;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author jiaok
 * @Date 2024-08-27 14:44
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CameraFlowCollectionPlatformPage extends BasePage<CameraFlowCollectionPlatform> {

    @ApiModelProperty(value = "主机")
    private String host;

    @ApiModelProperty(value = "端口")
    private String port;

    @ApiModelProperty(value = "appkey")
    private String appKey;

    @ApiModelProperty(value = "appSecret")
    private String appSecret;


    @Override
    public QueryWrapper<CameraFlowCollectionPlatform> getQuery(QueryWrapper<CameraFlowCollectionPlatform> queryWrapper) {
        return super.getQuery(queryWrapper)
                .like(!(StringUtils.isBlank(host)),"host",host)
                .ge((!com.alibaba.druid.util.StringUtils.isEmpty(getDatebegin())), "camera_flow_collection_platform.create_time", getDatebegin())
                .lt((!com.alibaba.druid.util.StringUtils.isEmpty(getDateend())), "camera_flow_collection_platform.create_time", getDateend())
                .orderByDesc("camera_flow_collection_platform.create_time");
//                .ge((!com.alibaba.druid.util.StringUtils.isEmpty(getDatebegin())), "cfcp.create_time", getDatebegin())
//                .lt((!com.alibaba.druid.util.StringUtils.isEmpty(getDateend())), "cfcp.create_time", getDateend())
//                .orderByDesc("cfcp.create_time");
    }
}
